<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<link rel="stylesheet" href="${staticServer}/inc/style/main.css" />
<link rel="stylesheet" href="${staticServer}/inc/style/page.css" />
<link rel="stylesheet" href="${staticServer}/css/work_today.css" />
<link rel="stylesheet" href="${staticServer}/inc/style/date/datepicker.css" />
<script src="${staticServer}/inc/js/jquery.js"></script>
<script src="${staticServer}/inc/js/pageset.js"></script>
<script src="${staticServer}/inc/js/datepicker.js"></script>
<script>

$(function(){
	$("#nickname").val("${nickname}");
	$("#startTime").val("${startTime}");
	$("#endTime").val("${endTime}");
	$("#xun_user").val("${xun_user}");
});
var selectMsg = function(){
	var nickname = $("#nickname").val();
	var startTime = $("#start_date").val();
	var endTime = $("#end_date").val();
	var xun_user = $("#xun_user").val();
	window.location.href=encodeURI("${contextPath}/index/work_manager.htm?nickname="+nickname+"&startTime="+startTime+"&endTime="+endTime+"&xun_user="+xun_user);
}

$("body").ready(function(){
	select_date( 'start_date' );
	select_date( 'end_date' );
});

function select_date( targetid )
{
	$( '#' + targetid ).Zebra_DatePicker( { format: 'Y-m-d' } );
}

function starquery(type)
{
	if(type==0)
	{
		var sdate = $("#start_date").val();
		var edate = $("#end_date").val();
		var name = $("#nickname").val();
		var param = "";
	
		if(sdate!="") param += "&s=" + sdate;
		if(edate!="") param += "&e=" + edate;
		if(name!="") param += "&n=" + name;
	
		location.href = "?" + param;
	}
	else
	{
		location.href = "?";
	}
}
</script>
</head>

<body>
	<div id="home_link">
		<ul>
			<li>竞思教育网络办公系统 v2.0 beta</li>
			<li>&gt;</li>
			<li>工作管理</li>
			<li>&gt;</li>
			<li class="current"></li>
		</ul>
	</div>
	<div id="container">
		<div id="title"></div>
		<table class="form_table">
			<tr>
				<td><label><b>查询条件：</b></label> 
				<label for="start_date">起始日期：</label> <input type="text" id="start_date" size="15" value="" /> 
				<label for="end_date">终止日期：</label> <input type="text" id="end_date" size="15" value="" /> 
				<label for="nickname">姓名：</label> <input type="text" id="nickname" size="15" value="" /> 
				<label for="xun_user">训练老师账号：</label> <input type="text" id="xun_user" size="15" value="" /> 
				<input type="button" value=" 查 询 " onclick="selectMsg()" /></td>
			</tr>
		</table>
		<table>
			<tr class="fields">
				<th>办公地址</th>
				<th>职位</th>
				<th>姓名</th>
				<th>日期</th>
				<th width="15%">详情</th>
			</tr>
			
			<#if list??>
				<#list list as list>
				<tr class="even_row">
					<td align="center">${list.region}</td>
					<td align="center">${list.department}（${list.job}）</td>
					<#if list.nickname!=''>
					<td align="center">${list.nickName}</td>
					<#else>
					<td align="center">${list.username}</td>
					</#if>
					<td align="center">${list.createTime}</td>
					<td align="center"><a href="${contextPath}/index/work_view.htm?username=${list.username}&time=${list.createTime}">查看工作日志详情</a></td>
				</tr>
				</#list>
			</#if>
			
		</table>
	</div>
	<div id="pager" style="width: 820px;">
	<ul id="pagination">
		<#if page??>
		<#if page.pagetotal?? && page.pagetotal!="0">
	<#assign pagetotal = page.pagetotal>
	<#else>
	<#assign pagetotal = 1>
	</#if>
			<#if page.currpage??>
	<#assign currpage = page.currpage>
	<#else>
	<#assign currpage = 1>
	</#if>
				<#if currpage==1 >
					<li class="previous-off">上一页</li>
					<#else>
					<li class="previous"><a href="${contextPath}/index/work_manager.htm?currPage=${currpage-1}&nickname=${nickname}&startTime=${startTime}&endTime=${endTime}">上一页</a></li>
					</#if>
					
		<#if pagetotal<=11>
			<#list 1..pagetotal as index_up>  
	           <#if currpage==index_up > 
	           		<li class="current">${index_up}</li>
	           <#else>
	           		<li><a href="${contextPath}/index/work_manager.htm?currPage=${index_up}&nickname=${nickname}&startTime=${startTime}&endTime=${endTime}">${index_up}</a></li>  
	           </#if>  
			</#list>  
		<#else>
			<#if currpage<=8 >
				<#list 1..9 as index_up>  
	           	<#if currpage==index_up >  
	            	<li class="current">${index_up}</li>
	           	<#else>  
	               <li><a href="${contextPath}/index/work_manager.htm?currPage=${index_up}&nickname=${nickname}&startTime=${startTime}&endTime=${endTime}">${index_up}</a></li> 
	           	</#if>
	           	</#list>  
	           	<li>...</li>
	           	<li><a href="${contextPath}/index/work_manager.htm?currPage=${pagetotal}&nickname=${nickname}&startTime=${startTime}&endTime=${endTime}">${pagetotal}</a></li>  
				
			<#elseif (currpage>= 9 && currpage<pagetotal-7)  >	
				<li><a href="${contextPath}/index/work_manager.htm?currPage=1&nickname=${nickname}&startTime=${startTime}&endTime=${endTime}">1</a></li>  
				<li>...</li>
				<#list currpage-3..currpage+3 as index_up>  
	           	<#if currpage==index_up >  
	             <li class="current">${index_up}</li>
	           	<#else>  
	               <li><a href="${contextPath}/index/work_manager.htm?currPage=${index_up}&nickname=${nickname}&startTime=${startTime}&endTime=${endTime}">${index_up}</a></li>  
	           	</#if>
	           	</#list>
				<li>...</li>
	           	<li><a href="${contextPath}/index/work_manager.htm?currPage=${pagetotal}&nickname=${nickname}&startTime=${startTime}&endTime=${endTime}">${pagetotal}</a></li>   
			<#else>
				<li><a href="${contextPath}/index/work_manager.htm?currPage=1&nickname=${nickname}&startTime=${startTime}&endTime=${endTime}">1</a></li> 
				<li>...</li>
				<#list pagetotal-8..pagetotal as index_up>  
	           	<#if currpage==index_up >  
	             <li class="current">${index_up}</li>
	           	<#else>  
	               <li><a href="${contextPath}/index/work_manager.htm?currPage=${index_up}&nickname=${nickname}&startTime=${startTime}&endTime=${endTime}">${index_up}</a></li> 
	           	</#if>
				</#list>  
			</#if>
			
		</#if> 
		<#if currpage==pagetotal >
		 	<li class="previous-off">下一页</li>
		<#else>
			<li class="previous"><a href="${contextPath}/index/work_manager.htm?currPage=${currpage+1}&nickname=${nickname}&startTime=${startTime}&endTime=${endTime}">下一页</a></li>
		</#if>
		<li class="pageinfo">共${page.total}条记录</li>
	</#if>
	</ul>
	</div>
	<div class="emptyline clear"></div>
</body>
</html>